<input hidden="hidden" id="navValue" value="资产总览">
<link rel="stylesheet" type="text/css" media="all" href="/static/assets/css/daterangepicker-bs3.css" />
<!--<script type="text/javascript" src="/static/assets/js/jquery-1.8.3.min.js"></script>-->
<!--<script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>-->
<script type="text/javascript" src="/static/assets/js/moment.js"></script>
<script type="text/javascript" src="/static/assets/js/daterangepicker.js"></script>
<div class="page-content">
    <div class="page-header">
        <h1>
            账户资产
            <small>
                <i class="ace-icon fa fa-angle-double-right"></i>
                账户列表
            </small>
        </h1>
    </div><!-- /.page-header -->
    <div class="row">
        <from class="form-horizontal user-data" role="form">
            <div class="form-group">
                <div class="col-md-4 no-margin-right no-padding-right">
                    <label class="col-sm-4 control-label no-padding-right" for="form-field-1"> 手机号码: </label>
                    <input type="text" name="phone" placeholder="请输入手机号码" class="col-sm-6" value="{if $phone!=''}{$phone}{else}{/if}">
                </div>
                <div class="col-md-4 no-margin-right no-padding-right">
                    <label class="col-sm-4 control-label no-padding-right" for="form-field-1"> 姓&nbsp;名: </label>
                    <input type="text" name="realname" placeholder="请输入姓名" class="col-sm-6" value="{if $realname!=''}{$realname}{else}{/if}">
                </div>

                <button type="submit" id="searchBtn" style="margin-left: 30px;" class="dt-button buttons-collection buttons-colvis btn btn-white btn-primary btn-bold" tabindex="0" aria-controls="dynamic-table" data-original-title="" title="查询"><span><i class="fa fa-search bigger-110 blue"></i></span></button>

            </div>
        </from>
    </div><!-- /.row -->
    {if !empty($list)}
    <div class="row">
        <div class="col-xs-12">
            <table id="simple-table" class="table  table-bordered table-hover">
                <thead>
                <tr>
                    <th class="detail-col center">序号</th>
                    <th class="center">ID</th>
                    <th class="center">账户昵称</th>
                    <th class="center">姓名</th>
                    <th class="center">手机号</th>
                    <th class="center">牡丹苗</th>
                    <th class="center">分红权</th>
                    <th class="center">营销分</th>
                    <th class="center">牡丹分</th>
                    <th class="center">余额</th>
                    <th class="center">购物券</th>
                    <th class="center">沃积分</th>
                </tr>
                </thead>

                <tbody>
                {foreach $list as $key=> $val}
                <tr  class="center">
                    <td>  <?php echo ($page-1)*10+$key+1?></td>
                    <td>{$val['id']}</td>
                    <td>{$val['nickname']}</td>
                    <td>{if $val['realname']==''}- - -{else}{$val['realname']}{/if}</td>
                    <td>{$val['mobile']}</td>
                    <td>{$val['sapling_num']}</td>
                    <td><a  href="{:url('shareholders/shares')}?id={$val['id']}">{$val['shares']}</a></td>
                    <td><a  href="{:url('marketing/info')}?mobile={$val['mobile']}">{$val['credit8']}</a></td>
                    <td><a  href="{:url('peony/grades')}?mobile={$val['mobile']}">{$val['credit7']}</a></td>
                    <td><a  href="{:url('marketing/balanceinfo')}?mobile={$val['mobile']}">{$val['credit2']}</a></td>
                    <td><a  href="{:url('marketing/couponinfo')}?mobile={$val['mobile']}">{$val['credit4']}</a></td>
                    <td><a  href="{:url('shareholders/mywotntegral')}?type=4&phone={$val['mobile']}">{$val['credit9']}</td>
                </tr>
                {/foreach}
                </tbody>
            </table>
            {$page_html['html']}
        </div><!-- /.span -->
    </div><!-- /.row -->
    {else/}
    <div class="row" style="font-size: 14px;margin-top: 50px;"><center>{$message} </center></div>
    {/if}
</div>

<script>
    $(function () {
        $("#searchBtn").click(function () {
            var reg = /^1[3578]\d{9}$/;
            var phone = $('input[name="phone"]').val();

            var realname = $('input[name="realname"]').val();
            var text_href = '';
            if(realname){
                text_href += "realname="+realname;
            }
            if(phone!=""){
                if(reg.test(phone)){
                    text_href += "&phone="+phone;
                }
                else{
                    if(phone)
                    alert("请输入正确的手机号码");
                    $('input[name="phone"]').val('');
                    return false;
                }
            }
            if(text_href){
                text_href = "?"+text_href;
            }
            location.href=location.href.split('?')[0]+text_href;
        });

        $(".showBtn").click(function () {
            var id = $(this).attr('mark');
            var date = $(this).parents('tr').find(".dateval").text().split(' ')[0];
            var url = "{:url('performance/detail')}";
            url = url + '?sid='+id+"&date="+date;

            layer.open({
                type: 2,
                title: false,
                shade: [0],
                area: ['1200px', '600px'],
                offset: 'auto', //右下角弹出
                shift: 2,
                content:url

            });
        });
        $(document).keyup(function(event){
            if(event.keyCode ==13){
                $("#searchBtn").trigger("click");

            }
        });
    })
</script>
<script type="text/javascript">
    $(document).ready(function() {
        $('#search_date').daterangepicker({ singleDatePicker: true }, function(start, end, label) {
            console.log(start.toISOString(), end.toISOString(), label);
        });
    });
</script>